// 合同管理api
import api from "../utils/http";
export default {

  // -----------------------------------材料管理合同--------------------------------------------------------

  // 多条件查询采购合同
  searchPurchaseContract (factor) {
    return api({
      url: "/RoutineHeTong/selectPurchaseHeTong",
      method: 'post',
      data: {
        ...factor
      }
    })
  },
  // 材料管理合同
  stuffContract (currentP, pageS, proID) {
    return api({
      url: "/MaterialHeTong/selectHeTong",
      method: 'post',
      data: {
        currentPage: currentP,
        pageSize: pageS,
        projectId: proID
      }
    })
  },
  // 删除材料合同
  delStuffContract (id) {
    return api({
      url: "/MaterialHeTong/deleteById",
      method: 'post',
      params: {
        id: id
      }
    })
  },
  // 查看材料合同详情
  getDetails (id) {
    return api({
      url: "/MaterialHeTong/selectById",
      method: 'get',
      params: {
        id: id
      }
    })
  },
  // 编辑材料采购合同
  editStuff (id) {
    return api({
      url: "/MaterialHeTong/updateHeTong",
      method: 'post',
      params: {
        id
      }
    })
  },
  // 新增材料合同
  uploadFile (fromData) {
    console.log(fromData);
    return api({
      url: "/constructionHeTong/insertHeTong",
      method: 'post',
      data: {
        ...fromData
      },
      emulateJSON: true,
      withCredentials: true,
      headers: {
        "content-type": "multipart/form-data"
      }
    })
  },
  // -----------------------------------------------施工班组合同--------------------------------------------
  // 获取所有,条件查询施工班组合同
  getBuildTeamContract (factor) {
    return api({
      url: "/constructionHeTong/selectHeTong",
      method: 'post',
      data: {
        ...factor
      }
    })
  },
  // 获取当前施工班组合同详情
  getBuildTeamContractDetails (id) {
    return api({
      url: "/constructionHeTong/selectById",
      method: 'get',
      params: {
        id
      }
    })
  },
  // 删除施工班组合同
  delBuildTeamContract (id) {
    return api({
      url: "/constructionHeTong/deleteById",
      method: 'post',
      params: {
        id
      }
    })
  },
  // 添加施工班组（未完成）---后端参数不够
  addBuildTeamContract (factor) {
    return api({
      url: "/constructionHeTong/insertHeTong",
      method: 'post',
      params: {
        ...factor
      }
    })
  },

  // -------------------------------------------------常规合同----------------------------------------------
  // 多条件搜索材料管理合同
  searchStuffContract (factor) {
    return api({
      url: "/MaterialHeTong/selectHeTong",
      method: 'post',
      data: {
        ...factor
      }
    })
  },
  // 销售合同api
  // 多条件查询销售合同
  searchSaleContract (factor) {
    return api({
      url: "/RoutineHeTong/selectSaleHeTong",
      method: 'post',
      data: {
        ...factor
      }
    })
  },
  // ------------------------------------------项目合同API---------------------------------------------
  // 查看项目合同
  projectContract (currentP, pageS, proID) {
    return api({
      url: "/projectHeTong/selectHeTong",
      method: 'post',
      data: {
        currentPage: currentP,
        pageSize: pageS,
        projectId: proID
      }
    })
  },
  // 多条件搜索项目合同
  searchProjectContract (factor) {
    return api({
      url: "/projectHeTong/selectHeTong",
      method: 'post',
      data: {
        ...factor
      }
    })
  },
  // 根据id查询项目合同详情
  getProjectDetails (id) {
    return api({
      url: "/projectHeTong/selectById",
      method: 'get',
      params: {
        id
      }
    })
  },
  // ----------------------------------------type下拉框APA-------------------------------------------
  // 获取用印类型
  getPrinting () {
    return api({
      url: "/constructionHeTong/selectChapterWithType",
      method: 'get'
    })
  },
  // 关联项目下拉框
  relationSelect () {
    return api({
      url: "/constructionHeTong/selectDropDownProject",
      method: 'get'
    })
  },
  // 部门下拉框
  depSelect () {
    return api({
      url: "/constructionHeTong/selectDept",
      method: 'get'
    })
  },
  // 项目下拉框
  projectSelect () {
    return api({
      url: "/constructionHeTong/selectDropDownProject",
      method: 'get'
    })
  },
  // 施工班组下拉框
  buildTeamSelect () {
    return api({
      url: "/constructionHeTong/selectConstructionTeam",
      method: 'get'
    })
  },
  // 经办人下拉框
  staffSelect () {
    return api({
      url: "/constructionHeTong/selectEmployee",
      method: 'get'
    })
  },
  // 供应商下拉框
  supplierSelect () {
    return api({
      url: "/constructionHeTong/selectSupplier",
      method: 'get'
    })
  },
  // 计价方式
  pricingSelect () {
    return api({
      url: "/constructionHeTong/selectValuation",
      method: 'get'
    })
  }
  // 
  // 
}